package com.dds.system.service.union.impl;

import java.util.List;
import java.util.Map;

import com.dds.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dds.system.mapper.union.UnionShopManagerMapper;
import com.dds.system.domain.union.UnionShopManager;
import com.dds.system.service.union.IUnionShopManagerService;

/**
 * 联盟商家管理员Service业务层处理
 * 
 * @author gaolianjie
 * @date 2021-04-14
 */
@Service
public class UnionShopManagerServiceImpl implements IUnionShopManagerService 
{
    @Autowired
    private UnionShopManagerMapper unionShopManagerMapper;

    /**
     * 查询联盟商家管理员
     * 
     * @param shopId 联盟商家管理员ID
     * @return 联盟商家管理员
     */
    @Override
    public UnionShopManager selectUnionShopManagerById(String shopId)
    {
        return unionShopManagerMapper.selectUnionShopManagerById(shopId);
    }

    /**
     * 查询联盟商家管理员列表
     * 
     * @param unionShopManager 联盟商家管理员
     * @return 联盟商家管理员
     */
    @Override
    public List<UnionShopManager> selectUnionShopManagerList(UnionShopManager unionShopManager)
    {
        return unionShopManagerMapper.selectUnionShopManagerList(unionShopManager);
    }

    /**
     * 新增联盟商家管理员
     * 
     * @param unionShopManager 联盟商家管理员
     * @return 结果
     */
    @Override
    public int insertUnionShopManager(UnionShopManager unionShopManager)
    {
        unionShopManager.setCreateTime(DateUtils.getNowDate());
        return unionShopManagerMapper.insertUnionShopManager(unionShopManager);
    }

    /**
     * 修改联盟商家管理员
     * 
     * @param unionShopManager 联盟商家管理员
     * @return 结果
     */
    @Override
    public int updateUnionShopManager(UnionShopManager unionShopManager)
    {
        return unionShopManagerMapper.updateUnionShopManager(unionShopManager);
    }

    /**
     * 批量删除联盟商家管理员
     * 
     * @param shopIds 需要删除的联盟商家管理员ID
     * @return 结果
     */
    @Override
    public int deleteUnionShopManagerByIds(String[] shopIds)
    {
        return unionShopManagerMapper.deleteUnionShopManagerByIds(shopIds);
    }

    /**
     * 删除联盟商家管理员信息
     * 
     * @param shopId 联盟商家管理员ID
     * @return 结果
     */
    @Override
    public int deleteUnionShopManagerById(String shopId)
    {
        return unionShopManagerMapper.deleteUnionShopManagerById(shopId);
    }

    @Override
    public List<Map<String, Object>> selectManagerByShopId(String shopId) {
        return unionShopManagerMapper.selectManagerByShopId(shopId);
    }
}
